package com.lz.homedecoration.common.controller;

import com.lz.homedecoration.common.bean.PageResult;
import com.lz.homedecoration.common.request.PageReq;
import com.lz.homedecoration.common.response.ResultRes;
import com.lz.homedecoration.entity.User;
import org.springframework.web.bind.annotation.*;

import java.util.List;

public abstract class BaseController<T> {

    @GetMapping("/list")
    public abstract ResultRes list();

    @GetMapping("/get/{id}")
    public abstract ResultRes get(@PathVariable Long id);

    @PostMapping("/add")
    public abstract ResultRes add(@RequestBody User user);

    @RequestMapping(value = "/update",method = RequestMethod.PATCH)
    public abstract ResultRes update(@RequestBody User user);

    @RequestMapping(value = "/delete/{id}",method = RequestMethod.DELETE)
    public abstract ResultRes delete(@PathVariable Long id) throws Exception;

    @PostMapping("/pageList")
    public abstract ResultRes pageList(@RequestBody PageReq pageReq);
}
